package com.xjg.jms;

import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;

import com.xjg.domain.MessageInfo;

public class Sender {
	private JmsTemplate jmsTemplate;
    //getter and setter
    public JmsTemplate getJmsTemplate() {
        return jmsTemplate;
    }
    public void setJmsTemplate(JmsTemplate jmsTemplate) {
        this.jmsTemplate = jmsTemplate;
    }
    
    public void sendInfo(MessageInfo message) {
    	jmsTemplate.convertAndSend(message);
       /* jmsTemplate.send(new MessageCreator() {
            public Message createMessage(Session session) throws JMSException {
                MapMessage message = session.createMapMessage();
                message.setString("lastName", "ppp");
                return message;
            }

        });*/
    }
}
